<template>
  <div v-show="this.show">
    <el-container>
        <el-header>Header</el-header>
        <el-main>Main</el-main>
    </el-container>
  </div>
</template>

<script>
export default {
    data(){
        return{
            key:1,
            show:true
        }
    },
    methods: {
        showPage(key){
            if(key==this.key){
                this.show = true
            }
            else{
                this.show = false   
            }
        }
    },
    mounted() {
        this.$bus.$on("showPage",this.showPage)
    },
    beforeDestroy(){
        this.$bus.$off("showPage");
    }
}
</script>

<style>

</style>